import dayjs from 'dayjs'

export const tableColumns = [
  {
    title: '英雄名称',
    key: 'name',
    dataIndex: 'name',
    ellipsis: true,
  },
  {
    title: '上线时间',
    key: 'landingDate',
    dataIndex: 'landingDate',
    ellipsis: true,
    render: (value: string) => {
      return value ? dayjs(value).format('YYYY-MM-DD') : ''
    }
  },
  {
    title: '版本强度',
    key: 'versionStrength',
    dataIndex: 'versionStrength',
    ellipsis: true,
  },
  {
    title: '英雄定位',
    key: 'heroLocation',
    dataIndex: 'heroLocation',
    render: (values: string[]) => {
      const positionMap = new Map([
        ['1', '射手'],
        ['2', '辅助'],
        ['3', '中路'],
        ['4', '边路'],
        ['5', '打野'],
      ])
      return values.map((item: string) => positionMap.get(item)).join(', ')
    }
  }
]
